using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MonitorTemperatura.Operciones;
using MonitorTemperatura.Entidades;

namespace MonitorTemperatura.View.Configuracion
{
    public partial class Configuracion : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                Comun c = new Comun();
               RadioButtonListServerBD.SelectedValue =  c.Serverestatus().ToString();

            }

        }

        protected void ButtonBD_Click(object sender, EventArgs e)
        {
            Comun op = new MonitorTemperatura.Operciones.Comun();
            op.DeleteAll();
        }

        protected void RadioButtonListServerBD_SelectedIndexChanged(object sender, EventArgs e)
        {
          if( RadioButtonListServerBD.SelectedValue=="False")
          {
              Comun c = new Comun();
              c.stopServer();
          }
          else
          {
              Comun c = new Comun();
              c.AsyncStartServer();
          }
        }
    }
}
